/*
 * @Author:
 * @Date: 2022-11-24 13:56:00
 * @LastEditors:
 * @LastEditTime: 2022-12-23 16:14:07
 * @FilePath: \immoka-admin\src\utils\request\req.inter.token.js
 * @Description:
 *
 * Copyright (c) 2022 by  , All Rights Reserved.
 */
import { getToken } from '@/utils/auth'

export function setUpToken(config) {
  const ignorePath = ["/admin/login", "/oss/sts"]
  let passFlag = false

  ignorePath.forEach(path => {
    if (config.url.endsWith(path)) passFlag = true
  })

  if (passFlag) return config

  config.headers["token"] = getToken();
  return config
}

